package avatar;

import java.util.Vector;

public class avatarparammanager {
	public static avatarparammanager Instance;
	public static avatarparammanager getInstance()
	{
		if(Instance == null)
		{
			Instance = new avatarparammanager();
		}
		return Instance;
	}
	public Vector<avatarparamdata> avatarparamdatavec = new Vector<avatarparamdata>();
	public void Add(avatarparamdata data)
	{
		avatarparamdatavec.add(data);
	}
	public void Set(avatarparamdata data)
	{
		for(int i=0; i<avatarparamdatavec.size(); i++)
		{
			if(avatarparamdatavec.get(i).id == data.id)
			{
				avatarparamdatavec.get(i).difen = data.difen;
				avatarparamdatavec.get(i).type = data.type;
				avatarparamdatavec.get(i).chaoguorennum = data.chaoguorennum;
				avatarparamdatavec.get(i).chaoguojiqirennum = data.chaoguojiqirennum;
				avatarparamdatavec.get(i).robotcount = data.robotcount;
				avatarparamdatavec.get(i).openTime = data.openTime;
			}
		}
	}
	public avatarparamdata Find(int difen, int type)
	{
		for(int i=0; i<avatarparamdatavec.size(); i++)
		{
			if(avatarparamdatavec.get(i).difen == difen && avatarparamdatavec.get(i).type == type)
			{
				return avatarparamdatavec.get(i);
			}
		}
		return new avatarparamdata();
	}
}
